package com.atguigu.gmall.list.bean;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

/**
 * @author 钟涛
 * @version 1.0
 * @description: TODO
 * @date 2021/12/17 18:37
 */
@Data
@Document(indexName="guiguperson",shards = 2,replicas = 1)
public class Person {
    @Id  //这是一个主键
    @Field(type = FieldType.Long)
    private Long id;
    @Field(type = FieldType.Keyword)
    private String userName;
    @Field(type = FieldType.Text)
    private String email;
    @Field(type = FieldType.Text)
    private String address;
    @Field(type = FieldType.Long)
    private Integer age;
//    @Field(store = false,index = false)
    private String msg;

    @Field(type = FieldType.Date,pattern = "yyyy-MM-dd",format = DateFormat.custom)
    private Date birth;
}
